//求一个整型数组的平均值
public class Test {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6};
        System.out.println(average(arr));
    }
    public static double average(int[] arr){
        double sum = 0;
        for(int x:arr){
            sum += x;
        }
        return sum / arr.length;
    }
}
